class Solution(object):
    def maxArea(self, height):
        """
        :type height: List[int]
        :rtype: int
        """
        if height is None or len(height) <= 1:
            return 0

        max_area = 0
        left_idx, right_idx = 0, len(height)-1
        while left_idx < right_idx:
            cur_area = (right_idx - left_idx) * min(height[right_idx], height[left_idx])
            if cur_area > max_area:
                max_area = cur_area
            if height[left_idx] < height[right_idx]:
                left_idx = left_idx + 1
            else:
                right_idx = right_idx - 1

        return max_area
